import { createI18n } from "vue-i18n";
import messages from "./lang/index";
import EventBus from 'utils/EventBus.js'

// 默认语言
let historylang = localStorage.getItem("historylang");
const langDefault = historylang ? historylang : "zh-CN";

const i18n = createI18n({
  locale: langDefault, //默认显示的语言
  messages,
});

EventBus.emit('setLocale', langDefault)

export default i18n;